<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据列表</title>
{#    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">#}
    <style>
        body {
            background-color: #f8f9fa;
            padding-top: 2rem;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
        }
        h1 {
            text-align: center;
            margin-bottom: 2rem;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }
        th, td {
            padding: 12px;
            text-align: center;
            border: 1px solid #ddd;
        }
        th {
            background-color: #007bff;
            color: white;
        }
        tr:nth-child(even) {
            background-color: #f2f2f2;
        }
        a {
            margin-right: 10px;
            text-decoration: none;
            color: white;
            padding: 6px 12px;
            border-radius: 5px;
        }
        a.btn-warning {
            background-color: #ffc107;
        }
        a.btn-danger {
            background-color: #dc3545;
        }
        a:hover {
            text-decoration: none;
            color: #000;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>数据列表</h1>
        <a href="{% url 'create_data12a' %}" class="btn btn-primary mb-3">创建新记录</a>
        <table class="table table-bordered">
            <thead>
                <tr>
                    <th>月份</th>
                    <th>区域1奖数量</th>
                    <th>区域2奖数量</th>
                    <th>区域3奖数量</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {% for item in data %}
                <tr>
                    <td>{{ item.month }}</td>
                    <td>{{ item.region_1_award_amount }}</td>
                    <td>{{ item.region_2_award_amount }}</td>
                    <td>{{ item.region_3_award_amount }}</td>
                    <td>
                        <a href="{% url 'update_data12a' item.pk %}" class="btn btn-warning btn-sm">编辑</a>
                        <a href="{% url 'delete_data12a' item.pk %}" class="btn btn-danger btn-sm">删除</a>
                    </td>
                </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
</body>
</html>